#######################################################
# The class of Finite DEVS  
# Author: moonho.hwang@gmail.com
#   Date: Oct.19.2011
#######################################################
from XSY.DEVS.FRTDEVS import *

class FDDEVS(FRTDEVS):
   ''' the class of DDEVS M=(X,Y,S,tau,delta_0, delta_x,delta_y). The characteristic functions tau, delta_0, delta_x, and delta_y don't have stochastic features.  Since the verification can be done in the way of FSDEVS, these non-stochastic functions tau, delta_0, delta_x, and delta_y are interpreted in tau, rv_delta_0, delta_x, and rv_delta_y, respectively via generating reachabilty graph of FSDEVS. The users need to override the functions of M instead of these rv_{delta_{0,x,y} }. '''
   def __init__(m, name, parent=None):
      '''constructor:'''
      FRTDEVS.__init__(m, name, parent), 
  
   def rv_tau(m):
      '''random lifetime scheduling function'''
      return DRV({m.tau():1})

   def tau(m):
      '''lifetime scheduling function'''
      raise Exception("%s is not overrided!"%function_name())

if __name__ == "__main__":
   print 'mini test of FDDEVS'
   fg = FDDEVS("hmh")
   print fg

